package com.kotlin.demo

class Ktbase23 {

}

fun main() {
    val count = "skdjsd".count()
    val count1 = "skdsl".count {
        it == 's'
    }
    println(count1)

    //函数的声明
    val funaaa: () -> String
    //函数的实现
    funaaa = {
        val a = 80
        "lsadlajf" //匿名函数最后一行 代表函数的返回值
    }

    println(funaaa()) //打印这个函数的返回值
    println(funaaa)   //打印这个函数


    //多个参数的写法
    val methodAction: (Int, Int, Int) -> String = { number1, number2, nubmer3 ->
        val aaa = 9999
        "$aaa 参数1:$number1 param2:$number2 param3:$nubmer3"
    }

    println(methodAction(1,2,3))

}
